package com.ruoyi.business.uitls;

import com.rabbitmq.client.*;

public class RabbitMQUtil {
    public static Connection getConnection() throws Exception {
        // 1、创建连接工厂
        ConnectionFactory connectionFactory = new ConnectionFactory();
        // 2、设置参数
        connectionFactory.setHost("47.95.177.252");
        connectionFactory.setPort(5672);
        connectionFactory.setVirtualHost("/car_service");
        connectionFactory.setUsername("gyz");
        connectionFactory.setPassword("123456");
        // 3、创建连接
        Connection connection = connectionFactory.newConnection();
        return connection;
    }
}